def Singleton(cls):
    """单例装饰器类实现"""
    _instances = {}

    def __init__(cls,name,bases,attrs):
        super().__init__(name, bases, attrs)
        print(f"初始化元类: {name}")

    def __call__(self, *args, **kwargs):
        if self.cls not in self._instances:
            self._instances[self.cls] = self.cls(*args, **kwargs)
        return self._instances[self.cls]